"""
    
    Home made Lynx clone for demostrating Movz usage.
 
"""

__author__ = "Mikko Ohtamaa <mikko@redinnovation.com>"
__docformat__ = "epytext"
__copyright__ = "Red Innovation Ltd."
__license__ = "BSD"

import os
import sys

# Boostrap PYTHONPATH

#: Movz framework path - assume it's copied under TARGETDRIVE:\Python

if os.path.exists(os.path.join("c:", "python", "movz")):
    movz_path=os.path.join("c:", "python")
else:
    movz_path=os.path.join("e:", "python")    

#: Python 2.2 distribution files which are not included in PyS60 download
missing_dist_path=os.path.join(movz_path, "movz", "client", "s60", "missing_python_dist")

sys.path.append(movz_path)
sys.path.append(missing_dist_path)

print sys.path
import logging

from movz.client.s60.app.application import Application

class Browser(Application):
    
    def get_name(self):
        return "Red Browser"
    
    def get_app_path(self):
        return "C:\\Python"
    
    def get_splash_screen(self):
        return ((255, 255, 255,), os.path.join(self.get_app_path(), "browser_splash.png.nogallery"))
    
    def prepare(self):        
        logger = self.get_logger()
        logger.info("Launching " + self.get_name())
    
    def cycle(self):
        pass
    
if __name__ == "__main__":    
    # This .py is executed as the start point of the application'
    browser = Browser()
    browser.start()